package com.jxb.netty.network.nio;

import java.util.Scanner;

public class NioClient {

    private static NioClientHandle nioClientHandle;
    public static void main(String[] args) throws Exception {
        nioClientHandle = new NioClientHandle("127.0.0.1",8888);
        new Thread(nioClientHandle).start();

        Scanner scanner = new Scanner(System.in);
        while(NioClient.sendMsg(scanner.next()));
    }

    private static boolean sendMsg(String next) throws Exception {
        nioClientHandle.sendMsg(next);
        return true;
    }

}
